From 68843a3e93913c12d00b47380614f67e7e9763b4 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 5 Dec 2011 10:59:07 +0100 Subject: [PATCH] gdk: Remove unused _gdk_window_calculate_full_clip_region --- gdk/gdkinternals.h | 5 --- gdk/gdkwindow.c | 108 --------------------------------------------- 2 files changed, 113 deletions(-) diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 8567fd4fb3..3042bcb9d4 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -400,11 +400,6 @@ void _gdk_display_set_window_under_pointer (GdkDisplay *display, void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window); -cairo_region_t *_gdk_window_calculate_full_clip_region (GdkWindow *window, - GdkWindow *base_window, - gboolean do_children, - gint *base_x_offset, - gint *base_y_offset); gboolean _gdk_window_has_impl (GdkWindow *window); GdkWindow * _gdk_window_get_impl_window (GdkWindow *window); diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 4c669b51b4..a3a62669a4 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -7631,114 +7631,6 @@ gdk_window_is_shaped (GdkWindow *window) return window->shaped; } -static void -window_get_size_rectangle (GdkWindow *window, - GdkRectangle *rect) -{ - rect->x = rect->y = 0; - rect->width = window->width; - rect->height = window->height; -} - -/* Calculates the real clipping region for a window, in window coordinates, - * taking into account other windows, gc clip region and gc clip mask. - */ -cairo_region_t * -_gdk_window_calculate_full_clip_region (GdkWindow *window, - GdkWindow *base_window, - gboolean do_children, - gint *base_x_offset, - gint *base_y_offset) -{ - GdkRectangle visible_rect; - cairo_region_t *real_clip_region; - gint x_offset, y_offset; - GdkWindow *parentwin, *lastwin; - - if (base_x_offset) - *base_x_offset = 0; - if (base_y_offset) - *base_y_offset = 0; - - if (!window->viewable || window->input_only) - return cairo_region_create (); - - window_get_size_rectangle (window, &visible_rect); - - /* real_clip_region is in window coordinates */ - real_clip_region = cairo_region_create_rectangle (&visible_rect); - - x_offset = y_offset = 0; - - lastwin = window; - if (do_children) - parentwin = lastwin; - else - parentwin = lastwin->parent; - - /* Remove the areas of all overlapping windows above parentwin in the hiearachy */ - for (; parentwin != NULL && - (parentwin == window || lastwin != base_window); - lastwin = parentwin, parentwin = lastwin->parent) - { - GList *cur; - GdkRectangle real_clip_rect; - - if (parentwin != window) - { - x_offset += lastwin->x; - y_offset += lastwin->y; - } - - /* children is ordered in reverse stack order */ - for (cur = parentwin->children; - cur && cur->data != lastwin; - cur = cur->next) - { - GdkWindow *child = cur->data; - - if (!GDK_WINDOW_IS_MAPPED (child) || child->input_only) - continue; - - /* Ignore offscreen children, as they don't draw in their parent and - * don't take part in the clipping */ - if (gdk_window_is_offscreen (child)) - continue; - - window_get_size_rectangle (child, &visible_rect); - - /* Convert rect to "window" coords */ - visible_rect.x += child->x - x_offset; - visible_rect.y += child->y - y_offset; - - /* This shortcut is really necessary for performance when there are a lot of windows */ - cairo_region_get_extents (real_clip_region, &real_clip_rect); - if (visible_rect.x >= real_clip_rect.x + real_clip_rect.width || - visible_rect.x + visible_rect.width <= real_clip_rect.x || - visible_rect.y >= real_clip_rect.y + real_clip_rect.height || - visible_rect.y + visible_rect.height <= real_clip_rect.y) - continue; - - cairo_region_subtract_rectangle (real_clip_region, &visible_rect); - } - - /* Clip to the parent */ - window_get_size_rectangle ((GdkWindow *)parentwin, &visible_rect); - /* Convert rect to "window" coords */ - visible_rect.x += - x_offset; - visible_rect.y += - y_offset; - - cairo_region_intersect_rectangle (real_clip_region, &visible_rect); - } - - if (base_x_offset) - *base_x_offset = x_offset; - if (base_y_offset) - *base_y_offset = y_offset; - - return real_clip_region; -} - void _gdk_window_add_damage (GdkWindow *toplevel, cairo_region_t *damaged_region) -- 2.30.2